﻿using NUnit.Framework;
using SpecFlowTfsLinker.Parser;
using SpecFlowTfsLinker.Test.Common;
using SpecFlowTfsLinker.Test.Resources;

namespace SpecFlowTfsLinker.Test.Parser
{
    [TestFixture]
    public class TestCaseParserTest : TestInitialization
    {
        [Test]
        public void CanParseCompleteTestCaseWithoutParameter()
        {
            var userStory = TestCaseParser.Create(TestCaseResources.GutterGame.Name,
                                                       TestCaseResources.GutterGame.CompleteTestCase);
            Assert.IsNotNull(userStory);
            Assert.IsTrue(userStory.Given.Count == 1);
            Assert.IsTrue(userStory.When.Count == 1);
            Assert.IsTrue(userStory.Then.Count == 2);
        }

        [Test]
        public void CanParseGivenWithParameter()
        {
            var userStory = TestCaseParser.Create(TestCaseResources.GutterGame.Name,
                                                       TestCaseResources.Addition.CompleteFeatureTestCase);
            Assert.IsNotNull(userStory);
            Assert.IsTrue(userStory.Given.Count == 3);
            Assert.IsTrue(userStory.When.Count == 2);
            Assert.IsTrue(userStory.Then.Count == 2);
        }
    }
}